package com.hyt.it.ogt.kq.service.gov.model.dto.admission;

import java.time.LocalDateTime;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hyt.it.ogt.kq.common.utils.LocalDateTimeConverter;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 准考证查看下载信息实体
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "准考证查看下载信息实体DTO", description = "准考证查看下载信息实体")
public class ExportTicketViewDTO {
	
	
	@ColumnWidth(15)
    @ExcelProperty(value = "准考证号", order = 0)
    @ApiModelProperty(value = "准考证号")
    private String admissionSerialNumber;
	
	
    @ColumnWidth(10)
    @ExcelProperty(value = "姓名", order = 1)
    @ApiModelProperty(value = "考生姓名")
    private String examineeName;
    
    
    @ColumnWidth(18)
    @ExcelProperty(value = "手机号码", order = 2)
    @ApiModelProperty(value = "手机号")
    private String examineePhone;
    
    
    @ColumnWidth(25)
    @ExcelProperty(value = "证件号码", order = 3)
    @ApiModelProperty(value = "证件号码")
    private String identificationNo;

    
    @ColumnWidth(10)
    @ExcelProperty(value = "查看状态", order = 4)
    @ApiModelProperty(value = "查看状态")
    private String viewStatusDesc;
    
    /**
     * 准考证查看次数
     */
    @ColumnWidth(10)
    @ExcelProperty(value = "准考证查看次数", order = 5)
    @ApiModelProperty(value = "准考证查看次数")
    private Integer ticketViewTimes;

    
    /**
     * 准考证最后查看时间
     */
    @ColumnWidth(20)
    @ExcelIgnore
    @ExcelProperty(value = "准考证最后查看时间", converter = LocalDateTimeConverter.class, order = 6)
    @ApiModelProperty(value = "准考证最后查看时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastTicketViewTime;
    
    
    @ColumnWidth(10)
    @ExcelProperty(value = "下载状态", order = 7)
    @ApiModelProperty(value = "下载状态")
    private String downLoadStatusDesc;
    
    /**
     * 准考证下载次数
     */
    @ColumnWidth(10)
    @ExcelProperty(value = "准考证下载次数", order = 8)
    @ApiModelProperty(value = "准考证下载次数")
    private Integer ticketDownloadTimes;
    
    /**
     * 准考证最后下载时间
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "准考证最后下载时间", converter = LocalDateTimeConverter.class, order = 9)
    @ApiModelProperty(value = "准考证最后下载时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime lastTicketDownloadTime;


    public String getViewStatusDesc() {
		Integer ticketViewTimesTemp = getTicketViewTimes();
		if(null != ticketViewTimesTemp && ticketViewTimesTemp.compareTo(0) > 0) {
			return "已查看";
		}else {
			return "未查看";
		}
	}

	
	public String getDownLoadStatusDesc() {
		Integer ticketDownloadTimesTemp = getTicketDownloadTimes();
		if(null != ticketDownloadTimesTemp && ticketDownloadTimesTemp.compareTo(0) > 0) {
			return "已下载";
		}else {
			return "未下载";
		}
	}
    
}
